﻿using DevExpress.XtraEditors;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SiparisKontrol
{
    public partial class frmSeriNo : XtraForm
    {
        private List<string> _serinolar = new List<string>();
        public int Miktar { get; set; }
        public List<string> Serinolar { get { return _serinolar; } }

        public frmSeriNo()
        {
            InitializeComponent();
        }

        private void frmSeriNo_Load(object sender, EventArgs e)
        {
            label1.Text = Miktar.ToString();
        }

        private void textEdit1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                if (!string.IsNullOrEmpty(textEdit1.Text))
                {
                    label2.Text = (Convert.ToInt32(label2.Text) + 1).ToString();
                    Miktar--;
                    _serinolar.Add(textEdit1.Text);
                    textEdit1.Text = "";

                    if (Miktar == 0)
                    {
                        this.DialogResult = System.Windows.Forms.DialogResult.OK;
                    }
                }
            }
        }
    }
}
